<%@page contentType="text/html;charset=utf-8" pageEncoding="UTF-8"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<t:template>
	<jsp:attribute name="include">
		<script type="text/javascript">
			function pageInit() {
				lazySelectInit = true;
			}

			function showModal() {
				initSelects(function() {
					$("#registrationModal").modal('show');
				});
			}
		</script>
	</jsp:attribute>
	<jsp:attribute name="pagetitle">
      Bejelentkezés
    </jsp:attribute>
	<jsp:body>
    	<spring:url var="authUrl" value="/static/j_spring_security_check" />
		<form:form method="post" class="signin form-horizontal"
			action="${authUrl}">
		
			<div class="control-group">
			    <label class="control-label" for="username">Felhasználói név:</label>
			    <div class="controls">
			      <input type="text" id="j_username" name="j_username"
						placeholder="Felhasználói név">
			    </div>
			</div>
			
			<div class="control-group">
			    <label class="control-label" for="password">Jelszó:</label>
			    <div class="controls">
			      <input type="password" id="j_password" name="j_password"
						placeholder="Jelszó">
			    </div>
			</div>
	
			<div class="control-group">
    			<div class="controls">
					<input type="checkbox" value="true"
						name="_spring_security_remember_me" />Jegyezz meg
				</div>
			</div>
	
			<div class="control-group">
    			<div class="controls btn-group">
					<input type="submit" class="btn btn-primary" name="login"
						value="Bejelentkezés" />
					<span class="divider-vertical"></span>
					<input type="button" class="btn btn-info" id="register"
						onclick="showModal(); return false;" value="Regisztráció" />
				</div>
			</div>
		</form:form>
		
		<div class="modal hide fade" id="registrationModal">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h3>Regisztráció</h3>
			</div>
			<div class="modal-body">
				<jsp:include page="_registration.jsp">
					<jsp:param value="true" name="isModal" />
		    	</jsp:include>
			</div>
			<div class="modal-footer">
				<div class="btn-group">
					<input type="button" class="btn btn-primary"
						onclick="$('#registerForm').submit();" value="Regisztráció"
						id="regSubmitButton">
					<a href="#" class="btn" data-dismiss="modal">Bezárás</a>
				</div>
			</div>
		</div>
    </jsp:body>
</t:template>